<template>
    <div>
        <el-table
                :data="tableData"
                border
                style="width: 100%;margin-top: 40px">
            <el-table-column
                    prop="id"
                    label="编号"
                    align="center"
                    >
            </el-table-column>
            <el-table-column
                    prop="log"
                    label="获取途径"
                    align="center"
                   >
            </el-table-column>
            <el-table-column
                    prop="integral"
                    align="center"
                    label="所得积分">
            </el-table-column>
            <el-table-column
                    align="center"
                    label="操作">
                <template scope="scope">
                    <el-button type="text" @click="resetRule(scope.row)">修改</el-button>
                </template>
            </el-table-column>
        </el-table>
        <rules-dialog ref="rulesDialog" @reloadRules="reloadRules" />
    </div>
</template>

<script>
    import rulesDialog from './rules-dialog.vue'
    export default {
        name: "rules-tab.vue",
        components: {
            rulesDialog
        },
        props: {
            tableData: {
                type: Array,
                default() {
                    return []
                }
            }
        },
        methods: {
            resetRule(row) {
                console.log(row);
                this.$refs['rulesDialog'].dialogFormVisible = true
                this.$refs['rulesDialog'].form = JSON.parse(JSON.stringify(row))

            },
            reloadRules (){
                this.$emit('reloadRules')
            }
        }
    }
</script>

<style scoped>

</style>
